package com.woniu.mapper;

import com.woniu.pojo.Services;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.vo.QueryServiceInfortmationVo;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 服务管理表 Mapper 接口
 * </p>
 *
 * @author xiaotang
 * @since 2022-10-18
 */
public interface ServicesMapper extends BaseMapper<Services> {
    @Select("select s.id, ss.status, o.title, t.name teamName, d.name doctorName, p.name pageName, i.name itemName, s.service_source, s.service_address, s.appointment_time, s.submit_time, s.remarks, s.reject " +
            "from tb_services s, tb_service_status ss, tb_user u, tb_organization o, tb_team t, tb_doctor d, tb_package p, tb_item i where s.service_status_id = ss.id and s.user_id = u.id " +
            "and u.organization_id = o.id and u.team_id = t.id and s.doctor_id = d.id and u.package_id = p.id and s.item_id = i.id and s.id = #{servicesId}")
    @ResultType(QueryServiceInfortmationVo.class)
    QueryServiceInfortmationVo searchById(Long servicesId);
}
